import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/home',
  },
  {
    path: '/layout',
    component: () => import('@/views/layout'),
    redirect: '/layout/home',
    children: [
      {
        path: 'home',
        component: () => import('@/views/layout/child/home'),
      },
      {
        path: 'my',
        component: () => import('@/views/layout/child/my'),
      },
      {
        path: 'qa',
        component: () => import('@/views/layout/child/qa'),
      },
      {
        path: 'video',
        component: () => import('@/views/layout/child/video'),
      },
    ],
  },
  { path: '/login', component: () => import('@/views/login') },
]

const router = new VueRouter({
  routes,
})

export default router
